package fic.storefinder.client.content;

import com.google.gwt.user.client.ui.RootPanel;

public class ContentContainer {
	private static ContentContainer instance;
	private RootPanel rootPanel;
	private ContentAbstract currentContent;
	private ContentContainer() {
		this.rootPanel = RootPanel.get("pageContent");
		
	}
	
	public static synchronized ContentContainer getInstance() {
        if (null == instance) {
        	instance = new ContentContainer();
        }
        return instance;
	}
	
	public void setPageContent(ContentAbstract content) {
		if (currentContent != null) {
			currentContent.removeFromParent();
		}
		rootPanel.add(content);
		this.currentContent = content;
	}


}
